<!DOCTYPE html>
<html lang="{{.Locale}}">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="refresh" content="3600">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="theme-color" content="#fff">
    <title>{{.Title}}</title>
    <link rel="stylesheet" href="{{asset .Domain "/fonts/fonts.css" .ContextName}}">
    <link rel="stylesheet" href="{{asset .Domain "/css/cozy-bs.min.css" .ContextName}}">
    <link rel="stylesheet" href="{{asset .Domain "/styles/theme.css" .ContextName}}">
    <link rel="stylesheet" href="{{asset .Domain "/styles/cirrus.css" .ContextName}}">
    {{.Favicon}}
  </head>
  <body class="cirrus{{if .Inverted}} {{end}}">
    <main class="wrapper">
      <header class="wrapper-top">
        <a href="https://cozy.io/" class="btn p-2 d-sm-none">
          {{if .Inverted}}
          <img src="{{asset .Domain "/images/logo-dark.svg"}}" alt="Twake Workplace" class="logo" />
          {{else}}
          <img src="{{asset .Domain "/images/logo-light.svg"}}" alt="Twake Workplace" class="logo" />
          {{end}}
        </a>
      </header>

      <div class="d-flex flex-column align-items-center mb-md-3">
        {{if .Illustration}}<img src="{{asset .Domain .Illustration}}" alt="" class="illustration mb-3" />{{end}}
        <h1 class="h4 h2-md mb-3 text-center">{{if .ErrorTitle}}{{t .ErrorTitle}}{{else}}{{t "Error Title"}}{{end}}</h1>
        <div class="mb-2 mb-md-3">
          {{$err := t .Error}}
          {{$arr := split $err "\n"}}
          {{range $i, $p := $arr}}
            {{if ne $p ""}}<p class="text-center mb-2">{{$p}}</p>{{end}}
          {{end}}
        </div>
        {{if .ErrorDetail}}
        <div class="mt-2 mb-4 mb-md-5 d-flex flex-row">
          <span class="halo-icon shadow me-3"><span class="icon icon-info"></span></span>
          <p class="small">{{t .ErrorDetail}}</p>
        </div>
        {{end}}
        {{if .Link}}
        <a href="{{.LinkURL}}" class="mb-3">{{t .Link}}</a>
        {{end}}
      </div>

      <footer>
        {{if .SupportEmail}}
        <p class="text-center mb-3">
          {{t "Error Contact us" }} <a href="mailto:{{.SupportEmail}}">{{.SupportEmail}}</a>.
        </p>
        {{end}}
        {{if .Button}}
        <a href="{{.ButtonURL}}" class="btn btn-primary mb-3 w-100">{{t .Button}}</a>
        {{end}}
      </footer>
    </main>
    <script src="{{asset .Domain "/scripts/cirrus.js"}}"></script>
  </body>
</html>
